(function ($) {
    $.fn.serializeJson = function () {
        var serializeObj = {};
        var array = this.serializeArray();
        var str = this.serialize();
        $(array).each(
            function () {
                if (serializeObj[this.name]) {
                    if ($.isArray(serializeObj[this.name])) {
                        serializeObj[this.name].push(this.value);
                    } else {
                        serializeObj[this.name] = [
                            serializeObj[this.name], this.value];
                    }
                } else {
                    serializeObj[this.name] = this.value;
                }
            });
        return serializeObj;
    };
})(jQuery);

// 重置iframe高度
function reinitTreeHight(iframe, clazz, height) {
    if (!clazz) {
        clazz = '.page-content';
    }
    if (!height) {
        height = height > $('.page-content').outerHeight() ? height : $('.page-content').outerHeight();
        if (height < $(clazz).outerHeight()) {
            height = $(clazz).outerHeight();
        }
    }
    if (iframe.style) {
        if (height < 600) {
            iframe.style.height = 600 + "px";
        }
        else {
            iframe.style.height = height + "px";
        }
    }
}